package com.shop2cn.iapi.agentproducts.testcase;

import java.util.ArrayList;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.shop2cn.iapi.agentproducts.parameter.AddAgentProductBean;
import com.shop2cn.iapi.agentproducts.parameter.GetPriceByCatalogIdListBean;
import com.shop2cn.iapi.agentproducts.parameter.ImportAgentProductBean;
import com.shop2cn.iapi.agentproducts.parameter.ModifyAgentProductBean;
import com.shop2cn.iapi.agentproducts.parameter.ModifyCatalogDto;
import com.shop2cn.iapi.agentproducts.parameter.ProductDetailsDto;
import com.shop2cn.iapi.agentproducts.service.GetPriceByCatalogIdListCall;
import com.ymatou.iapi.dguser.parameter.UserCreateBean;
import com.ymatou.iapi.godmch.parameter.CreateCodeBean;
import com.ymatou.iapi.godmch.parameter.createmchBean;
import com.ymatou.iapi.godmch.service.CreateCodeCall;
import com.ymatou.iapi.prodstock.parameter.AgentProductPo;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.AddAgentProductCallService;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.YmtCatalogsI;
import com.ymttest.database.sqlwapper.YmtCatalogsIWapper;
import com.ymttest.database.sqlwapper.YmtProductsIWapper;
import com.ymttest.utils.AgentUsers;

/**
*查询规格售价和代理价
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetPriceByCatalogIdList{
	private static GetPriceByCatalogIdListBean getpricebycatalogidlistBean;
	private static GetPriceByCatalogIdListCall getpricebycatalogidlistCall;
    //渠道商
    private static int sellerId = AgentUsers.rootUserId;
    private static String sellerName = "NickautoTest";
    //渠道商->代理商1
    private static int agentUserId1 = AgentUsers.agentUserId1;
    private static String agentUserName1 = "NickautoTest";
    //渠道商->代理商2
    private static int agentUserId2 = AgentUsers.agentUserId2;
    private static String agentUserName2 = "NickautoTest";

    //vip渠道
    private static int vipRootUserId = AgentUsers.vipRootUserId;
    private static String vipRootUserName = "NickautoTest";
    //vip渠道->代理
    private static int vipAgentUserId1 = AgentUsers.vipAgentUserId1;
    private static String vipAgentUserName1 = "dgsq408897016";
    //vip渠道->代理->代理
    private static int vipAgentUserId2 = AgentUsers.vipAgentUserId2;
    private static String vipAgentUserName2 = "NickautoTest";

    private static YmtCatalogsIWapper ymtCatalogsIWapper = new YmtCatalogsIWapper();
    private static YmtProductsIWapper ymtProductsIWapper = new YmtProductsIWapper();
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询规格售价和代理价");
	}

	@Before
	public void caseUp() {
		getpricebycatalogidlistBean=new GetPriceByCatalogIdListBean();
		getpricebycatalogidlistCall=new GetPriceByCatalogIdListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getpricebycatalogidlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	public List<String> setCatlogList(String productId) throws InterruptedException {
        List<YmtCatalogsI> ymtCatalogsIList = ymtCatalogsIWapper.selectCatalogsByProductId(productId);
        List<String> catalogIdList = new ArrayList<>();
        ymtCatalogsIList.forEach(p->{
            catalogIdList.add(p.getsCatalogId());
        });
        return catalogIdList;
    }


    public void verifyDB(GetPriceByCatalogIdListBean getpriceBean) throws InterruptedException {
        ymtCatalogsIWapper.getPriceByCatalogIds(getpriceBean.getCatalogIdList()).forEach(p->{
			getpricebycatalogidlistCall.getCatalogPriceList().forEach(x->{
				if (p.getCatalogId().equals(x.getCatalogId())&&p.getAgentPrice()!=0){
					Logger.verifyEquals(x.getAgentPrice(),p.getAgentPrice(),"验证agentPrice");
					Logger.verifyEquals(x.getDirectPrice(),p.getDirectPrice(),"验证directPrice");
					try {
						YmtCatalogsI ymtCatalogsI = ymtCatalogsIWapper.selectCatalogsByCatalogId(x.getCatalogId());
						YmtCatalogsI ymtCatalogsI1 = ymtCatalogsIWapper.selectCatalogsByCatalogId(ymtCatalogsI.getRootCatalogId());
						Logger.verifyEquals(x.getRootUserId(),ymtCatalogsI1.getiUserId(),"验证RootUserId");
						AgentProductPo agentProductPo = ymtProductsIWapper.selectAgentProductByProductId(ymtCatalogsI1.getsProductId());
						Logger.verifyEquals(x.getCurrency(),agentProductPo.getCurrency(),"验证Currency");
//						Logger.verifyEquals(x.getDomestic(),,"验证domestic");

					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			});
		});
	}
    
    public void DomesticverifyDB(GetPriceByCatalogIdListBean getpriceBean) throws InterruptedException {
        ymtCatalogsIWapper.getPriceByCatalogIds(getpriceBean.getCatalogIdList()).forEach(p->{
			getpricebycatalogidlistCall.getCatalogPriceList().forEach(x->{
				if (p.getCatalogId().equals(x.getCatalogId())&&p.getAgentPrice()!=0){
					Logger.verifyEquals(x.getAgentPrice(),p.getAgentPrice(),"验证agentPrice");
					Logger.verifyEquals(x.getDirectPrice(),p.getDirectPrice(),"验证directPrice");
					try {
						YmtCatalogsI ymtCatalogsI = ymtCatalogsIWapper.selectCatalogsByCatalogId(x.getCatalogId());
						YmtCatalogsI ymtCatalogsI1 = ymtCatalogsIWapper.selectCatalogsByCatalogId(ymtCatalogsI.getRootCatalogId());
						Logger.verifyEquals(x.getRootUserId(),ymtCatalogsI1.getiUserId(),"验证RootUserId");
						AgentProductPo agentProductPo = ymtProductsIWapper.selectAgentProductByProductId(ymtCatalogsI1.getsProductId());
						Logger.verifyEquals(x.getCurrency(),agentProductPo.getCurrency(),"验证Currency");
						Logger.verifyEquals(x.isDomestic(),true,"验证domestic");

					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			});
		});
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_01() {
		Logger.start(true,"商品未被代理查询规格售价和代理价");
		try {
            AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,false);
            String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
            getpricebycatalogidlistBean.setUserId(sellerId);
            getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_02() {
		Logger.start(true,"规格列表为空，查询失败");
		try {
			getpricebycatalogidlistBean.setUserId(sellerId);
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();			
			Logger.verifyEquals("500",getpricebycatalogidlistCall.getString("code"),"验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_04() {
		Logger.start(true,"vip渠道->vip1->vip2,查询vip2规格售价");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,true);
			addAgentProductBean.getCatalogList().get(0).getAgentPriceList().get(1).setAgentPrice(300);
			addAgentProductBean.getCatalogList().get(1).getAgentPriceList().get(1).setAgentPrice(300);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			//vip代理1
			ImportAgentProductBean importAgentProductBean = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId1,vipAgentUserName1,productId,vipRootUserId,true);
			String agentProductId = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean);
			//vip代理2
			ImportAgentProductBean importAgentProductBean1 = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId2,vipAgentUserName2,agentProductId,vipAgentUserId1,false);
			String agentProductId1 = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean1);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId1));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_03() {
		Logger.start(true,"普通代理商品查询规格售价");
		try {
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(sellerId,sellerName,true);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			ImportAgentProductBean importAgentProductBean = AddAgentProductCallService.initImportAgentProduct(agentUserId1,agentUserName1,productId,sellerId,false);
			String agentProductId = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean);
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_05() {
		Logger.start(true,"渠道商新增规格查询售价");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,true);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);

			ModifyAgentProductBean modifyAgentProductBean = AddAgentProductCallService.initModifyAgentProductBean(productId,addAgentProductBean);
			ModifyCatalogDto modifyCatalogDto = new ModifyCatalogDto();
			modifyCatalogDto.setOperateType(0);
			modifyCatalogDto.setDirectPrice(100);
			modifyCatalogDto.setStock(100);
			modifyCatalogDto.setPropertyValue("god");
			modifyCatalogDto.setSku(addAgentProductBean.getCatalogList().get(0).getSku());
			modifyCatalogDto.setAgentPriceList(addAgentProductBean.getCatalogList().get(0).getAgentPriceList());
			modifyAgentProductBean.getCatalogList().add(modifyCatalogDto);
			AddAgentProductCallService.modifyAgentProduct(modifyAgentProductBean);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_06() {
		Logger.start(true,"渠道商删除规格查询售价");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,true);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);

			ModifyAgentProductBean modifyAgentProductBean = AddAgentProductCallService.initModifyAgentProductBean(productId,addAgentProductBean);
			modifyAgentProductBean.getCatalogList().get(0).setOperateType(2);
			AddAgentProductCallService.modifyAgentProduct(modifyAgentProductBean);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_07() {
		Logger.start(true,"渠道商删除规格,查新下级商品规格代理价");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,true);
			addAgentProductBean.getCatalogList().get(0).getAgentPriceList().get(1).setAgentPrice(300);
			addAgentProductBean.getCatalogList().get(1).getAgentPriceList().get(1).setAgentPrice(300);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			//vip代理1
			ImportAgentProductBean importAgentProductBean = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId1,vipAgentUserName1,productId,vipRootUserId,true);
			String agentProductId = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean);
			//vip代理2
			ImportAgentProductBean importAgentProductBean1 = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId2,vipAgentUserName2,agentProductId,vipAgentUserId1,false);
			String agentProductId1 = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean1);

			ModifyAgentProductBean modifyAgentProductBean = AddAgentProductCallService.initModifyAgentProductBean(productId,addAgentProductBean);
			modifyAgentProductBean.getCatalogList().get(0).setOperateType(2);
			AddAgentProductCallService.modifyAgentProduct(modifyAgentProductBean);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId1));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_08() {
		Logger.start(true,"渠道商未设置代理价，下级代理商代理，获取成功");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(vipRootUserId,vipRootUserName,false);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			//vip代理1
			ImportAgentProductBean importAgentProductBean = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId1,vipAgentUserName1,productId,vipRootUserId,false);
			String agentProductId = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean);
			//vip代理2
			ImportAgentProductBean importAgentProductBean1 = AddAgentProductCallService.initImportAgentProduct(vipAgentUserId2,vipAgentUserName2,agentProductId,vipAgentUserId1,false);
			String agentProductId1 = AddAgentProductCallService.ImportAgentProduct(importAgentProductBean1);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");
			verifyDB(getpricebycatalogidlistBean);
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");
			verifyDB(getpricebycatalogidlistBean);
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(agentProductId1));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");
			verifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_09() {
		Logger.start(true,"根据被删除的商品规格查询商品，失败");
		try {
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(sellerId,sellerName,true);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			AddAgentProductCallService.DeleteProduct(productId, sellerId);//删除商品
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);//设置规格参数
			getpricebycatalogidlistCall.callService();//根据规格查询
			Logger.verifyEquals("null",getpricebycatalogidlistCall.getJsonObject().get("data").getAsJsonObject().get("catalogPriceList").toString(),"验证catalogPriceList为空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_010() {
		Logger.start(true,"根据被删除的商品规格查询商品，失败");
		try {
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(sellerId,sellerName,true);
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			AddAgentProductCallService.DeleteProduct(productId, sellerId);//删除商品
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);//设置规格参数
			getpricebycatalogidlistCall.callService();//根据规格查询
			Logger.verifyEquals("null",getpricebycatalogidlistCall.getJsonObject().get("data").getAsJsonObject().get("catalogPriceList").toString(),"验证catalogPriceList为空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_011() {
		Logger.start(true, "渠道商发布商品，下面自动继承的代理自动继承,判断进货价是否正确");
		try {
			// 创建两个用户
			UserCreateBean usercreateBean1 = DGUserCallService.initUsercreateBean();
			int userId_channl = DGUserCallService.UserCreateCall(usercreateBean1);
			usercreateBean1 = DGUserCallService.initUsercreateBean();
			int userId_agent = DGUserCallService.UserCreateCall(usercreateBean1);
			//设置渠道商
			createmchBean createmchbean = GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			// 给渠道商创建一个商品
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(userId_channl,
					usercreateBean1.getNickname(), true);
			double price=200;
			addAgentProductBean.getCatalogList().forEach(a->{
				a.setDirectPrice(price*2);
				a.getAgentPriceList().forEach(b->{
					b.setAgentPrice(price);
				});
			});
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);
			ProductDetailsDto selectProductDetails = AddAgentProductCallService.selectProductDetails(userId_channl, productId);
			List<String> catalogs=new ArrayList<>();
			selectProductDetails.getCatalogList().forEach(c->{
				catalogs.add(c.getCatalogId());
			});
			Thread.sleep(5000);
			// 渠道商创建一个邀请码，出来一个自动继承的代理商、自动继承渠道商刚才的商品
			CreateCodeBean createbean = GodmchManageCallService.InitcreateCodeBeanForAgent(userId_channl);
			createbean.setAgentModel(2);// 自动继承
			CreateCodeCall CreateCodeCall=GodmchManageCallService.createCodeCall(createbean);
			List<createmchBean> createmchList = GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl,
					userId_agent); //
			createmchList.get(0).setCode(CreateCodeCall.getCode());
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new createmchBean[createmchList.size()]));
			Thread.sleep(5000);
			
			
			Thread.sleep(5000);
			//渠道商查询
			getpricebycatalogidlistBean.setUserId(userId_channl);
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);//设置规格参数
			getpricebycatalogidlistCall.callService();//根据规格查询
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");			
			JsonArray asJsonArray = getpricebycatalogidlistCall.getJsonObject().getAsJsonObject("data").getAsJsonArray("catalogPriceList");
			
			//代理商查询
			getpricebycatalogidlistBean.setUserId(userId_agent);
			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);//设置规格参数
			getpricebycatalogidlistCall.callService();//根据规格查询
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");
			JsonArray asJsonArray1 = getpricebycatalogidlistCall.getJsonObject().getAsJsonObject("data").getAsJsonArray("catalogPriceList");
			
			
			//判断代理提货价 与渠道商提货价
			asJsonArray.forEach(a->{
				double asDouble = a.getAsJsonObject().get("directPrice").getAsDouble();
				double asDouble2 = a.getAsJsonObject().get("agentPrice").getAsDouble();
				Logger.verifyEquals(price*2,asDouble, "直销价");
				Logger.verifyEquals(0.0,asDouble2, "渠道商提货价");
			});
			asJsonArray1.forEach(a->{
				double asDouble = a.getAsJsonObject().get("directPrice").getAsDouble();
				double asDouble2 = a.getAsJsonObject().get("agentPrice").getAsDouble();
				Logger.verifyEquals(price*2,asDouble, "直销价");
				Logger.verifyEquals(price,asDouble2, "代理商提货价");
			});
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPriceByCatalogIdList_012() {
		Logger.start(true,"境内渠道商查询规格售价");
		try {
			//vip渠道
			AddAgentProductBean addAgentProductBean = AddAgentProductCallService.initAddAgentProduct(500772053,sellerName,false);
			addAgentProductBean.setCurrency("CNY");
			String productId = AddAgentProductCallService.AddAgentProduct(addAgentProductBean);

			getpricebycatalogidlistBean.setCatalogIdList(setCatlogList(productId));
			getpricebycatalogidlistCall.setData(getpricebycatalogidlistBean);
			getpricebycatalogidlistCall.callService();
			Logger.verifyEquals("200",getpricebycatalogidlistCall.getString("code"),"验证code");

			DomesticverifyDB(getpricebycatalogidlistBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	
	
}